package com.example.kaogong.sys.mapper;

import com.example.kaogong.sys.pojo.StudentPaper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.kaogong.sys.pojo.vo.StudentPaperInfoVo;
import com.example.kaogong.sys.pojo.vo.StudentPaperQuestionVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 学生试卷 Mapper 接口
 * </p>
 *
 * @author    
 * @since 2022-03-31
 */
@Mapper
public interface StudentPaperMapper extends BaseMapper<StudentPaper> {

    /**
     * 当前登录学生获取所有作答试卷的基本信息
     * @param sid
     * @return
     */
    List<StudentPaperInfoVo> getStudentAllStudentPaper(Integer sid);

    /**
     * 获取作答试卷各类型题目作答情况
     * @param studentPaperId
     * @param type
     * @return
     */
    List<StudentPaperQuestionVo> getStudentPaperQuestion(@Param("studentPaperId") Integer studentPaperId, @Param("type") int type);

    List<StudentPaperInfoVo> getAllUncheckedPaper(Integer teacherId);

    /**
     * 试卷作答
     * @param studentPaper
     * @return
     */
    int paperSubmit(StudentPaper studentPaper);
}
